package Homework;

public class Book {
        //修饰符 数据类型 变量名;
        private String bookName;
        private String author;//作者
        private String publisher;//出版社名
        private double price;//价格

        //修饰符 返回值类型 方法名（形参列表）{}

        public void setBookName(String bookParam){
            System.out.println("数据传输进入:" + bookParam);

            bookName = bookParam;
        }

        public String getBookName(){
            return bookName;
        }

        public void setAuthor(String authorParam){

            author = authorParam;
        }

        public String getAuthor(){

            return author;
        }

        public void setPublisher(String publisherParam){

            publisher = publisherParam;
        }

        public String getPublisher(){

            return publisher;
        }


        public void setPrice(double priceParam){

            price = priceParam;

        }

        public double getPrice(){
            return price;
        }


        public String getBookInfo(){

            return "书名:" + bookName +"\n作者:" + author
                    +"\n出版社名:" + publisher + "\n价格:" + price+ "$";
        }

    }
